package org.hpin.asset.service;


import java.util.List;

import org.hpin.asset.dao.BorrowinfoDao;
import org.hpin.asset.entity.Borrowinfo;
import org.hpin.common.core.orm.BaseEntity;
import org.hpin.common.core.orm.BaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service(value = "org.hpin.asset.service.BorrowinfoService")
@Transactional(rollbackFor = Exception.class)
public class BorrowinfoService extends BaseService{
	@Autowired
	private BorrowinfoDao borrowinfoDao;
	
	@Override
	public BaseEntity findById(String id) {
		return super.findById(id);
	}

	@Override
	public void save(BaseEntity baseEntity) {
		super.save(baseEntity);
	}
	
	public Borrowinfo findMax(){
		return borrowinfoDao.findMax();
	}
	/**
	 * 删除借用信息
	 * @param ids
	 */
	public void deleteMSG(String [] ids) {
		for(int i=0;i< ids.length;i++){
			Borrowinfo borrowinfo = (Borrowinfo) borrowinfoDao.findById(Borrowinfo.class,ids[i]);
			borrowinfoDao.delete(borrowinfo);
		}
	}
}
